package com.healthtop.dao;

import com.healthtop.mapper.XsGameCategoryMapper;
import com.healthtop.model.XsGameCategory;
import com.healthtop.model.XsGameCategoryExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class XsGameCategoryDao {

    @Autowired
    private XsGameCategoryMapper xsGameCategoryMapper;

    public XsGameCategory selectById(Long id) {
        return xsGameCategoryMapper.selectByPrimaryKey(id);
    }

    public void insert(XsGameCategory xsGameCategory) {
        xsGameCategoryMapper.insertSelective(xsGameCategory);
    }

    public void update(XsGameCategory xsGameCategory) {
        xsGameCategoryMapper.updateByPrimaryKeySelective(xsGameCategory);
    }

    public List<XsGameCategory> selectAll() {
        XsGameCategoryExample example = new XsGameCategoryExample();
        example.createCriteria().andDelFalgEqualTo("0");
        return xsGameCategoryMapper.selectByExample(example);
    }
}
